{% extends "web_user/layout.html" %}


{% block content %}
    <div class="container">
        <div class="panel panel-default">
            <div class="panel-heading">
            <h3 class="panel-title">{{ title }}</h3>
            </div>
        </div>
        <div class="panel-body">
            <form method="post" novalidate enctype="multipart/form-data"> <!-- novalidate去规避浏览器做的校验-->
                {% csrf_token %}
                {% for field in form %}
                    <div class="form-group">
                        <label>{{ field.label }}</label>  <!-- field.label会去取到models.py定义类的属性中的verbose_name-->
                        {{ field }}
                        <span style="color: red">
                          {{ field.errors.0 }} <!-- field.errors表示提交的字段中的错误信息-->
                        </span>
                    <!--<input type="text" class="form-control" placeholder="姓名" name="user"> -->
                </div>
                {% endfor %}
                <button type="submit" class="btn btn-primary">提交</button>
            </form>
        </div>
    </div>
{% endblock %}